#include <string>
#include <vector>
#include <iostream>

#include "Reservation.h"


Reservation::Reservation(Client* member_)
{

}

Client* Reservation::getClient()
{
	return _client;
}

Movie* Reservation::getMovie()
{
	return _movie;
}

void Reservation::reserve(Movie movie_)
{
	DataBaseManager _db;
	_db.connect();
	_db.reserveFilm(movie_.getID());
	_db.close();
	ENSURE0(movie_.getAvailablePieces == movie_.getAvailablePieces - 1);
}

void Reservation::cancelReservation(Movie movie_)
{
	DataBaseManager _db;
	_db.connect();
	_db.cancelResevedMovie(movie_.getID());
	_db.close();
	ENSURE0(movie_.getAvailablePieces == movie_.getAvailablePieces + 1);
}
